Do: CmdOpt_regex! CmdOpt_string o_fullname("fullname"),o_dir("dir"),o_group("group"), o_password("password"),o_shell("shell"); CmdOpt_int o_quota("quota"); CmdOpt *addmod_options[] = { &o_fullname, &o_dir, &o_group, &o_password, &o_shell, &o_quota, NULL }; CmdOpt_verb v_add("add",addmod_options,do_adduser), v_modify("modify",addmod_options,do_moduser); CmdOpt_verb *verbs[] = { &v_add, &v_modify }; main(int argc, char **argv) { String xtra; CmdParser cp(verbs,argv[0]); cp.parse(argv,xtra); cp.dispatch(); CmdLine cli(options,argv[0]); cli.parse(argv,xtra); cli.dump(); if (xtra.length()) cout << "Xtra: " << xtra << endl; } add usage? x allow abbrevs! x put in check for more option specified more then once! x put in reset() for all options at start of parse! x make some stuff required